USE [@DATABASE]

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_Depolar_isDeleted]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[Depolar] DROP CONSTRAINT [DF_Depolar_isDeleted]
END

USE [@DATABASE]

/****** Object:  Table [dbo].[Depolar]    Script Date: 02/11/2013 21:31:06 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Depolar]') AND type in (N'U'))
DROP TABLE [dbo].[Depolar]

USE [@DATABASE]

/****** Object:  Table [dbo].[Depolar]    Script Date: 02/11/2013 21:31:06 ******/
SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Depolar](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[CreateDate] [datetime] NULL,
	[CreateUser] [int] NULL,
	[UpdateDate] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[DepoAdi] [nvarchar](300) NULL,
	[Aciklama] [nvarchar](max) NULL,
	[Adres] [nvarchar](500) NULL,
	[Telefon] [nvarchar](50) NULL,
	[Fax] [nvarchar](50) NULL,
	[Email] [nvarchar](200) NULL,
	[YetkiliId] [int] NULL,
	[YetkiliAdSoyad]  AS (case when [YetkiliId]>(0) then [dbo].[fn_PersonelAdSoyad]([YetkiliId]) else '' end),
	[isDeleted] [bit] NULL,
 CONSTRAINT [PK_Depolar] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [dbo].[Depolar] ADD  CONSTRAINT [DF_Depolar_isDeleted]  DEFAULT ((0)) FOR [isDeleted]